//---------------------------------------------------------------------------
// CSync Class
// Author : Woo-Hyun Kim
// Email : woorung@icu.ac.kr
// Date : Jul. 7, 2006
//---------------------------------------------------------------------------
#ifndef CSyncH
#define CSyncH

#include <iostream>
#include <iterator>
#include <vector>
#include <list>
#include <algorithm>
#include <fstream>
#include <string>
#include <map>

#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <errno.h>

using namespace std;
//---------------------------------------------------------------------------
class CSync {
private :
	// for pipe
	int up_pipefd[2]; 
	int down_pipefd[2];

protected :
	virtual int initialize();

public :
	CSync();
	virtual ~CSync();

	virtual int tell_parent(pid_t pid);
	virtual int wait_parent();
	virtual int tell_child(pid_t pid);
	virtual int wait_child();
};
//---------------------------------------------------------------------------
#endif
